//
//  goodsCollectionViewCell.m
//  uniform
//
//  Created by Apple on 15/8/27.
//  Copyright (c) 2015年 giuseppe. All rights reserved.
//

#import "goodsCollectionViewCell.h"

@implementation goodsCollectionViewCell


- (id)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    if (self) {
        
        self.imageView = [[UIImageView alloc]init];
        [self addSubview:self.imageView];
        
        
        self.nameLabel = [[UILabel alloc]init];
        self.nameLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.nameLabel];
        
        
        self.soldNumberLabel = [[UILabel alloc]init];
        self.soldNumberLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.soldNumberLabel];
        
        
        self.addShoppingCartButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.addShoppingCartButton setImage:[UIImage imageNamed:@"add_trolley"] forState:UIControlStateNormal];
        [self addSubview:self.addShoppingCartButton];
        
        self.priceLabel = [[UILabel alloc]init];
        self.priceLabel.textAlignment = NSTextAlignmentCenter;
        [self.addShoppingCartButton addSubview:self.priceLabel];
        
        self.lineImageView = [[UIImageView alloc]init];
        self.lineImageView.backgroundColor = [UIColor grayColor];
        [self addSubview:self.lineImageView];

    }
    return self;
    
}


- (void)layoutSubviews {
    
    self.nameLabel.text = self.model.brief;
    self.soldNumberLabel.text = self.model.amount;
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:self.model.suiturl]];
    self.priceLabel.text = self.model.price;

    

}



@end
